package ${groupId}.${artifactIdProjectPackageName}.config;


import ${groupId}.${artifactIdProjectPackageName}.interceptor.LoginInfoSetInterceptor;
import ${groupId}.${artifactIdProjectPackageName}.interceptor.NeedLoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    LoginInfoSetInterceptor loginInfoSetInterceptor;
    @Autowired
    NeedLoginInterceptor needLoginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(loginInfoSetInterceptor).addPathPatterns("/${artifactId}/**").excludePathPatterns("/error", "/doc.html", "/webjars/**", "/swagger-resources/**","/v2/api-docs", "/favicon.ico");

        registry.addInterceptor(needLoginInterceptor).addPathPatterns("/${artifactId}/**").excludePathPatterns("/error", "/doc.html", "/webjars/**", "/swagger-resources/**","/v2/api-docs", "/favicon.ico");

    }

}
